package task15;

import java.util.Scanner;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 9:37
 * @description:
 */
public class PrinterTest {

  public static void main(String[] args) {
    System.out.println("请输入0或1,0表示HP，1表示Canon");
    Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();

    PrinterFactory pf =new PrinterFactory();
    Printer printer=pf.getPrinter(num);
    printer.open();
    printer.print();
    printer.close();
    /*if(num==0){
      HPrinter hPrinter=new HPrinter();
      hPrinter.close();
      hPrinter.open();
      hPrinter.print();
    }else if(num==1){
      CPrinter cPrinter=new CPrinter();
      cPrinter.close();
      cPrinter.open();
      cPrinter.print();
    }else {
      System.out.println("输入有误！");
    }*/
  }
}
